<template>
    <el-select :model-value="modelValue+''" @change="changeHandle" :placeholder="placeholder" clearable>
        <el-option :label="data.dictLabel" v-for="data in dataList" :key="data.dictValue" :value ="data.dictValue">{{data.dictLabel}}</el-option>
    </el-select>
</template>
<script setup>
import {getDictDataList} from "../utils/util.js";
import {ref} from "vue";

const emit = defineEmits(['update:modelValue'])
const props = defineProps({
  modelValue: [Number, String],
  dictType: String,
  placeholder: String
})
const dataList = ref(getDictDataList(props.dictType))
const changeHandle = (val) => {
	emit('update:modelValue', val)
}
</script>
